<h1 class='text-info'>Cliente</h1>

<?php
switch ($_GET['msg']) {
    case 1: echo "<script>alert('Cliente adicionado com sucesso!!!!');</script>"; break;
    case 2: echo "<script>alert('Cliente modificado com sucesso!!!!');</script>"; break;
}
?>

<a href="?s=ccliente&adicionar" class="btn btn-sm btn-primary" title="Adicionar cliente"><i class="glyphicon glyphicon-plus"></i> Adicionar novo cliente</a><br/><br/>
<table class="table table-striped table-hover">
    <tr>
        <th>Nome</th>
        <th>Endereço</th>
        <th>Telefone</th>
        <th>Opções</th>
    </tr>
    <?php foreach ($lista as $ele) { ?>
        <tr>
            <td><?= $ele['nome'] ?></td>
            <td><?= $ele['endereco'] ?></td>
            <td><?= $ele['telefone'] ?></td>
            <td>
                <a href="?s=ccliente&edit=<?= $ele['idcliente'] ?>" class="btn btn-xs btn-warning" title="editar cliente"><i class="glyphicon glyphicon-edit"></i></a>
                <a href="?s=ccliente&del=<?= $ele['idcliente'] ?>" class="btn btn-xs btn-danger" title="excluir cliente"><i class="glyphicon glyphicon-trash"></i></a>
            </td>
        </tr>
    <?php } ?>
</table>
